package net.ifilm.dao;

import java.util.List;

import net.ifilm.entity.FilmDiscuss;

import net.ifilm.entity.PageCount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class FilmDiscussDao extends BaseDao {
    
    public List<FilmDiscuss> queryFilmDiscussList(int filmId) {
        return super.queryForList("queryFilmDiscussList", filmId);
    }

    public int queryFilmDiscussCount(int filmId) {
        return (Integer)super.queryForObject("queryFilmDiscussCount", filmId);
    }

    public List<FilmDiscuss> queryFilmDiscussSplit(PageCount pageCount) {
        return super.queryForList("queryFilmDiscussSplit", pageCount);
    }

    public void insertDiscuss(FilmDiscuss filmDiscuss) {
        super.insert("insertDiscuss", filmDiscuss);
    }

    /**
     * 根据电影ID删除此电影的所有评论
     *
     * @param filmId
     */
    public void deleteDiscuess(int filmId) {
        super.delete("delDiscussById", filmId);
    }
    
} // /:~
